package com.base.cn.platform.os.service.exam.record;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 加载考试作答数据接口
 *
 * @author s.li
 * @date 2019/01/17
 */
@FeignClient(name = ExamBaseService.appName,configuration = FeignAuthConfig.class)
public interface LoadStartExamService extends ExamBaseService {

    /**
     * 加载考试的记录数据
     * @param condition 查询条件
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/loadExamRecord")
    Map<String,Object> loadExamRecord(@RequestBody Map<String, Object> condition);


    /**
     * 加载答题卡
     * @param userId 用户ID
     * @param examRecordId 考试记录ID
     * @param pageSize 每页获取的数量，与试题分页同步
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/loadExamRecordCard")
    Map<String,Object> loadExamRecordCard(@RequestParam("userId") BigDecimal userId,
                                          @RequestParam("examRecordId") BigDecimal examRecordId,
                                          @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize);


    /**
     * 加载试题记录数据
     * @param condition 查询条件
     * @param currentPage 页码
     * @param pageSize 查询数量
     * @return PageInfo<ExamQuestionRecord>
     */
    @RequestMapping(contextPath + "/loadExamQuestionRecord")
    Map<String,Object> loadExamQuestionRecord(@RequestBody Map<String, Object> condition,
                                              @RequestParam(value = "currentPage", defaultValue = "1", required = false) int currentPage,
                                              @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize);
}
